package com.itheima.method;

import java.util.Scanner;

public class MethodDemo01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请输入要打印的内容和次数,内容在前次数在后,中间用空格隔开:");
            String str = sc.next();
            int count = sc.nextInt();
            print(str, count);
            System.out.println("输入0结束代码运行");
            int number = sc.nextInt();
            if (number == 0)
                break;

        }
    }

    public static void print(String str, int count) {
        for (int i = 0; i < count; i++) {
            System.out.println(str);
        }
    }
}